/*
WARNING: DO NOT USE WITH MORE THAN THE FOLLOWING PARTS:
	MSP430G2452
	32768 CRYSTAL
	3.3V Regulator***

*** Do not use the 3.3V regulator AND the programming Vcc simultaneoulsy.
There is no protection for this.

*/
#include <msp430.h>

#define NULL 0x00
#define NOP __asm__ __volatile__("nop") 	//single cycle nop.
#define NOP2 __asm__ __volatile__("jmp $+0x02") 	//single cycle nop.
#define NOP5 __asm__ __volatile__("mov @R4,0(R4)") 	//single cycle nop.

void delay_ten_us(register unsigned int tens)
{
	tens--;
	while(tens--)
	{
		NOP5;
		NOP;
	}
	NOP2;
	NOP2;
}

int main()
{
	WDTCTL = WDTPW + WDTHOLD;

	P1DIR = 0xFF;
	P1OUT = 0xaa; //10101010
	P2DIR = 0xFF;
	P2OUT = 0xaa; //10101010

	while(1)
	{
		delay_ten_us(1000);
		P1OUT ^= 0xFF;
		P2OUT ^= 0xFF;
	}
	return 0;
}
